package db.facadelocals;

import db.entities.Patient;
import details.AddressDetails;
import details.PatientDetails;
import exceptions.PatientNotFoundException;
import exceptions.UsernameAlreadyExistsException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import javax.ejb.Local;

/**
 *
 * @author jeroen
 */
@Local
public interface PatientFacadeLocal {

    public void registerPatient(String username, String password, String ssn) throws UsernameAlreadyExistsException;

    public void registerPatient(String username, String password, String ssn, String name,
                        String surname, String bloodgroup, Calendar birthday, AddressDetails address) throws UsernameAlreadyExistsException;

    public void setPassword(String username, String password) throws PatientNotFoundException;

    public void setSsn(String username, String ssn) throws PatientNotFoundException;

    public void setName(String username, String name) throws PatientNotFoundException;

    public void setSurname(String username, String surname) throws PatientNotFoundException;

    public void setBloodgroup(String username, String bloodgroup) throws PatientNotFoundException;

    public void setBirthday(String username, Calendar birtyday) throws PatientNotFoundException;

    public void setAddress(String username, String a1, String a2, String city, String postalCode, String country, String phone, String email) throws PatientNotFoundException;

    public void setGPs(String username, ArrayList<String> GPs) throws PatientNotFoundException;

    public List<String> getGPs(String username) throws PatientNotFoundException;

    public void addGPToPatient(String usernamePatient, String usernameGP) throws PatientNotFoundException;

    public void removeGPFromPatient(String usernamePatient, String usernameGP) throws PatientNotFoundException;

    public void setLastConsult(String username, Date lastConsult) throws PatientNotFoundException;

    public void setNextConsult(String username, Date nextConsult) throws PatientNotFoundException;

    public PatientDetails getPatient(String username) throws PatientNotFoundException;

    public boolean existPatient(String username);

    public boolean isValidLogin(String username, String password);

    public List<PatientDetails> getAllPatients();

    void create(Patient patient);

    void edit(Patient patient);

    void remove(Patient patient);

    Patient find(Object id);

    List<Patient> findAll();

}
